package com.googlecode.bip.dao.utils;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Create objects key and value from {@link ResultSet}
 *
 * @see MappableGetter
 */
public interface MappableInstance<K,V>
{
    /**
     * Create a key object K from a {@link ResultSet}
     *
     * @param resultSet a valid {@link ResultSet}
     * @return a new key object K
     * @throws SQLException if any
     */
    public K newKey( ResultSet resultSet ) throws SQLException;

    /**
     * Create a value object V from a {@link ResultSet}
     *
     * @param resultSet a valid {@link ResultSet}
     * @return a new value object V
     * @throws SQLException if any
     */
    public V newValue( ResultSet resultSet ) throws SQLException;
}
